IPC (inter-process communication, interprocess communication) can have three ways of sharing information (along with the file system, with the kernel, with shared memory). (Of course, although it is interprocess communication, it can also be
Introduction: Pipelines are the oldest IPC method on Unix systems, and pipelines provide an elegant solution: given the two processes that run different programs, how can the output of one process in the shell be used as input to another process?
Linux inter-process communication (IPC) Programming Practice (2) FIFO naming Pipeline
In the previous article, we explained how to use anonymous pipelines to transmit data between processes, and also saw a defect in this method, these processes are
in the previous article , we explain how to use anonymous pipelines to pass data between processes, and also see a flaw in the way that these processes are initiated by a common ancestor process, which makes it inconvenient to exchange data between
1. Named Pipe (FIFO)
The pipeline is described in the previous article "one of Linux processes communication (IPC)-Pipeline". However, a major defect in pipeline application is that there is no name, so it can only be used for communication between
Basic Concepts:
Pipelines have no names, so their greatest disadvantage is that they can only be used between processes that have a common ancestor process. We cannot create a pipe between unrelated processes and use it as an IPC pipe (regardless of
The earliest IPC form on UNIX systems is pipeline, and pipeline creation uses the pipe function:
#include
int pipe (int pipefd[2]);
The function creates a one-way pipeline that returns two descriptors pipefd[0], and
FIFO named/Named PipesOne limitation of (anonymous) pipeline applications is that they can only communicate between processes that have a common ancestor (affinity).If we want to exchange data between unrelated processes , you can do this with a
Original article link
Inter-process communication refers to the Process Communication and information exchange between multiple processes. Linux IPC is basically inherited from the UNIX platform. It mainly includes the original Unix IPC, System v
Inter-process communication refers to the Process Communication and information exchange between multiple processes. Linux IPC is basically inherited from the UNIX platform. It mainly includes the original Unix IPC, System v ipc, and socket-based
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.